// ustomVariable.h: interface for the CustomVariable class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_USTOMVARIABLE_H__D9AC1D97_38A5_4E44_8D55_503D4E5D7C42__INCLUDED_)
#define AFX_USTOMVARIABLE_H__D9AC1D97_38A5_4E44_8D55_503D4E5D7C42__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "PropertyVariable.h"

namespace PropertySystem
{
	class DllExport CustomVariable
	{
	public:
		CustomVariable();
		virtual ~CustomVariable();
	
	public:
		virtual void Influence();
		virtual void UpdateData();

		const CString& Prompt() const {
			return m_strPrompt;
		}

		void Prompt(const CString& strPrompt){
			m_strPrompt = strPrompt;
		}

		CString PromptSource(){
			return m_strPromptSource;
		}

		void PromptSource(const CString& strSource){
			m_strPromptSource = strSource;
		}

		void Influence(const CString& strInflunce);

		PropertyVariable* PropertVar(){
			return m_pVar;
		}

		BOOL IsComboBox(){
			return !m_strPromptSource.IsEmpty();
		}

		const CStringArray& EffectData() const {
			return m_EffectData;
		}


		BOOL IsCanInluence(PropertyVariable* pVar);

		void ArrangePrior(INT nPrior){
			m_nPrior = nPrior;
		}

		INT ArrangePrior() const {
			return m_nPrior;
		}

		BOOL IsActive() const {
			return m_bIsActive;
		}

		void SetActive(BOOL bActive){
			m_bIsActive = bActive;
		}
	protected:
		void PropertVar(PropertyVariable* pVar){
			m_pVar = pVar;
		}

		void CopyCustomData(CustomVariable& Dis, const CustomVariable& Source);
	protected:
		CStringArray m_EffectData;

	private:
		INT m_nPrior;
		CString m_strPrompt;
		CString m_strPromptSource;
		CString m_strInflunce;
		PropertyVariable* m_pVar;
		CStringArray m_strInfluenceArr;
		BOOL m_bIsActive;
	};
};
#endif // !defined(AFX_USTOMVARIABLE_H__D9AC1D97_38A5_4E44_8D55_503D4E5D7C42__INCLUDED_)
